﻿namespace EyeSoft.Test.Threading.Tasks
{
	using EyeSoft.Threading.Tasks;

	using Microsoft.VisualStudio.TestTools.UnitTesting;

	using SharpTestsEx;

	[TestClass]
	public class TaskFactoryTest
	{
		[TestMethod]
		public void VerifyActionOnTaskAndContinueWithAreExecuted()
		{
			ITaskFactory taskFactory = new TaskFactoryWrapper();

			var done = false;
			var continueDone = false;

			taskFactory.StartNew(() => done = true).ContinueWith(t => continueDone = true).Wait();

			done.Should("StartNew task was not calledd.").Be.True();
		}
	}
}